package com.gjw.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
public class TestController {

//    @ResponseBody
    @RequestMapping(value = "/aa/{a}")
    public  Map test(@PathVariable(value = "a",required = false) int aab){
//        model.addAttribute("test","test1111");
        HashMap<String, Object> map = new HashMap<>();
        map.put("a",aab);
        map.put("b","b");
        return map;
    }

    @RequestMapping(value = "/test")
    public  Map test2(@RequestParam("name") String name){
//        model.addAttribute("test","test1111");
        System.out.println(name);
        HashMap<String, Object> map = new HashMap<>();
        map.put("a",name);
        return map;
    }
}
